package cn.yes.like;

import cn.yes.like.User;
//import com.sun.org.apache.xpath.internal.objects.XObject;
import org.apache.commons.lang3.RandomStringUtils;

import java.lang.reflect.Method;
import java.security.SecureRandomSpi;

public class Like {
    public static void main(String[] arge) throws Exception{

       String a=RandomStringUtils.randomAlphabetic(6);
       String b=RandomStringUtils.randomNumeric(6);
       System.out.println(a);
       System.out.println(b);
       User u=new User();
       u.setName("李可");
       u.setAge(21);
       System.out.println(u.getName());
       System.out.println(u.getAge());

        Class<?> UU=Class.forName("cn.yes.like.User");
        Object o=UU.newInstance();
        Method setName = UU.getMethod("setName", String.class);
        setName.invoke(o,"李可");
        Method getName = UU.getMethod("getName");
        System.out.println(getName.invoke(o));
        Object w=UU.newInstance();
        Method setAge = UU.getMethod("setAge", int.class);
        setAge.invoke(w,21);
        Method getAge = UU.getMethod("getAge");
        System.out.println(getAge.invoke(w));



    }
}

